package com.sky.myshop.services.impl;

import com.sky.myshop.services.ShapeEnum;
import com.sky.myshop.services.ShapeSeries;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 柱状图数据处理
 */
@Component
public class BarShapeSeries implements ShapeSeries {
    @Override
    public ShapeEnum getShape() {
        return ShapeEnum.BAR;
    }

    @Override
    public List getShapeData(List<Map> sdata) {
        List data = new ArrayList();
        for (Map mp:sdata){
            data.add(mp.get("buynum"));

        }
        return data;
    }
}
